import request from "../../utils/request.ts";

/**
 * 获取组织部门树结构
 */
export function ApiGetOrganizationTree() {
  return request({
    url: "/api/QuestionManage/GetRailwayTrainDepotStationList",
    method: "get",
  });
}
/**
 * 获取题库列表
 */
export function ApiGetQuestionBank(data) {
  return request({
    url: `/api/QuestionManage/GetQuestionBankList`,
    method: "post",
    data
  });
}
// export function ApiGetQuestionBank(params) {
//   return request({
//     url: `/api/app/question-bank`,
//     method: "get",
//     params
//   });
// }
/**
 * 获取单个题库详情
 */
export function ApiGetQuestionBankId(params: any) {
  return request({
    url: `/api/app/question-bank/${params.id}`,
    method: "get",
  });
}

/**
 * 添加题库
 */
export function ApiPostQuestionBank(data: any) {
  return request({
    url: `/api/QuestionManage/CreateQuestionBank`,
    method: "post",
    data
  });
}

/**
 * 获取试题列表，带答案
 */
export function ApiGetQuestion(data) {
  return request({
    url: `/api/QuestionManage/GetQuestionListByParam`,
    method: "post",
    data
  });
}
/**
 * 添加试题
 */
export function ApiPostQuestion(data: any) {
  return request({
    url: `/api/QuestionManage/CreateQuestion`,
    method: "post",
    data
  });
}
/**
 * 获取试题详情
 */
export function ApiGetQuestionId(params: any) {
  return request({
    url: `/api/app/question/${params.id}`,
    method: "get",
  });
}
/**
 * 获取试题详情，带答案
 */
export function ApiGetQuestionIdAnswer(params: any) {
  return request({
    url: `/api/QuestionManage/GetQuestionById`,
    method: "get",
    params
  });
}
/**
 * 删除试题
 */
export function ApiDelQuestionId(params: any) {
  return request({
    url: `/api/QuestionManage/DeleteQuestion`,
    method: "delete",
    params
  });
}
/**
 * 批量删除试题
 */
export function ApiDelQuestionBatch(data: any) {
  return request({
    url: `/api/app/question/batch-delete`,
    method: "post",
    data
  });
}
/**
 * 修改试题
 */
export function ApiPutQuestion(data: any) {
  return request({
    url: `/api/QuestionManage/UpdateQuestion`,
    method: "put",
    data
  });
}

/**
 * 获取工种
 */
export function ApiGetJob(params: any) {
  return request({
    url: `/api/app/job-post`,
    method: "get",
    params
  });
}










export function ApiGetQuestionBankList(params: any) {
  return request({
    url: `/api/QuestionManage/GetQuestionBankList`,
    method: "get",
    params
  });
}
